`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: 
// Engineer: 
// 
// Create Date:    14:24:10 08/28/2012 
// Design Name: 
// Module Name:    TimeParameters 
// Project Name: 
// Target Devices: 
// Tool versions: 
// Description: 
//
// Dependencies: 
//
// Revision: 
// Revision 0.01 - File Created
// Additional Comments: 
//
//////////////////////////////////////////////////////////////////////////////////
module TimeParameters(
    Prog_Sync,
    Interval,
    Time_Parameter_Selector,
    Time_Value,
    Value,Clock,Reset_Sync
	 );

    input Prog_Sync;
	 input Clock;
	 input Reset_Sync;
    input [1:0]Interval;
    input [1:0]Time_Parameter_Selector;
    input [3:0]Time_Value;
	 output [3:0]Value;
	 reg [3:0]Value;
	 reg [3:0]tbase;
	 reg [3:0]text;
	 reg [3:0]tyel;
	 initial begin
	 tbase=4'b0110;
	 text=4'b0011;
	 tyel=4'b0010;
	 end
	 always @ (posedge Clock) 
		begin
			if(Prog_Sync==1)
				begin
					case (Time_Parameter_Selector)
						2'b00  : tbase <= Time_Value;
						2'b01  : text <= Time_Value;
						2'b10  : tyel <= Time_Value;
					endcase
			  end
			if(Reset_Sync==1)
				begin
					tbase<=4'b0110;
					text<=4'b0011;
					tyel<=4'b0010;
				end
			/*else if (Interval==0)begin
				Value<=tbase;
			end
			else if (Interval==1)begin
				Value<=text;
			end
			else if (Interval==2)begin
				Value<=tyel;
			end*/
		
			else
				case (Interval)
					2'b00  : Value <= tbase;
					2'b01  : Value <= text;
					2'b10  : Value <= tyel;
					default : Value <= 0;
				endcase
			
		end    
endmodule
